<template>
	<view class="u-f-c u-f-ajc">
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoNewsDetailPage">去咨询详情页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoSearchResultPage">去搜索结果页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoHoTSearchPage">去热搜结果页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoLiveStudioPage">去直播间页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoShortVideoPage">去短视频页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoNewsInfoPage">去资讯页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="gotoHomeSchoolPage">去家校互动页面</u-button>
		
		<u-button :custom-style="customStyle" :ripple="true" size="medium" @click="opens">打开外部链接</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				customStyle: {
					marginTop: '20px', // 注意驼峰命名，并且值必须用引号包括，因为这是对象
					color: 'black',
					width:'200px'
				}
			}
		},
		methods: {
			// 跳转到 咨询详情页面
			gotoNewsDetailPage(){
				this.$global.navigate({url:'/pages/newsDetails/newsDetails'})
			},
			
			// 跳转到 搜索结果页面
			gotoSearchResultPage(){
				this.$global.navigate({url:'/pages/searchPages/searchResult/searchResult'})
			},
			
			// 跳转到 热搜结果页面
			gotoHoTSearchPage(){
				this.$global.navigate({url:'/pages/searchPages/hotSearch/hotSearch'})
			},
			
			// 跳转到直播间页面
			gotoLiveStudioPage(){
				this.$global.navigate({url:'/pages/liveRoom/liveRoom'})
			},
			
			// 跳转到小视频
			gotoShortVideoPage(){
				this.$global.navigate({url:'/pages/shortVideo/shortVideo'})
			},
			
			// 跳转到资讯
			gotoNewsInfoPage(){
				this.$global.navigate({url:'/pages/newsInfo/newsInfo'})
			},
			
			// 家校互动
			gotoHomeSchoolPage(){
				this.$global.navigate({url:'/pages/homeSchool/homeSchool'})
			},
			
			// 打开外部链接
			opens(){
				 plus.runtime.openURL('https://m.jd.com/', function(res) {  
					console.log(res);  
				});  
			}
			
		}
	}
</script>
